#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"
void Test1()
{
	SLNode* Plist = NULL;
	SLTPushBack(&Plist, 1);
	SLTPushBack(&Plist, 2);
	SLTPushBack(&Plist, 3);
	SLTPushBack(&Plist, 4);
	SLTPushBack(&Plist, 5);

	SLTPushFront(&Plist, 10);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 20);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 30);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 40);
	SLTPrint(Plist);
}
void Test2()
{
	SLNode* Plist = NULL;
	
	SLTPushFront(&Plist, 10);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 20);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 30);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 40);
	SLTPrint(Plist);

	SLTPopBack(&Plist);
	SLTPrint(Plist);
	
	SLTPopBack(&Plist);
	SLTPrint(Plist);

	SLTPopBack(&Plist);
	SLTPrint(Plist);


}
void Test3()
{
	SLNode* Plist = NULL;
	

	SLTPushFront(&Plist, 10);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 20);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 30);
	SLTPrint(Plist);

	SLTPushFront(&Plist, 40);
	SLTPrint(Plist);

	SLTPopFront(&Plist);
	SLTPrint(Plist);

	SLTPopFront(&Plist);
	SLTPrint(Plist);

	SLTPopFront(&Plist);
	SLTPrint(Plist);
	
}
void Test4()
{
	SLNode* Plist = NULL;
	SLTPushBack(&Plist, 1);
	SLTPushBack(&Plist, 2);
	SLTPushBack(&Plist, 3);
	SLTPushBack(&Plist, 4);
	SLTPushBack(&Plist, 5);

	SLNode* ret;
	ret = SLTFind(Plist, 3);
	SLTPrint(ret);

	 ret = SLTFind(Plist, 5);
	SLTPrint(ret);
     ret = SLTFind(Plist, 4);
	SLTPrint(ret);
     ret = SLTFind(Plist, 1);
	SLTPrint(ret);
	
}
void Test5()
{
	SLNode* Plist = NULL;
	SLTPushBack(&Plist, 1);
	SLTPushBack(&Plist, 2);
	SLTPushBack(&Plist, 3);
	SLTPushBack(&Plist, 4);
	SLTPushBack(&Plist, 5);
	SLTDestroy(&Plist);
}
void Test6()
{
	SLNode* Plist = NULL;
	SLTPushBack(&Plist, 1);
	SLTPushBack(&Plist, 2);
	SLTPushBack(&Plist, 3);
	SLTPushBack(&Plist, 4);
	SLTPushBack(&Plist, 5);

	SLNode* ret;
	ret = SLTFind(Plist, 5);
	SLTInsertAfter(&Plist, ret, 99);
	SLTPrint(Plist);

	ret = SLTFind(Plist, 99);
	SLTInsertAfter(&Plist, ret, 88);
	SLTPrint(Plist);

	ret = SLTFind(Plist, 88);
	SLTInsertAfter(&Plist, ret, 77);
	SLTPrint(Plist);


	ret = SLTFind(Plist, 99);
	SLTEraseAfter(&Plist, ret);
	SLTPrint(Plist);
	ret = SLTFind(Plist, 3);
	SLTEraseAfter(&Plist, ret);
	SLTPrint(Plist);
	ret = SLTFind(Plist, 99);
	SLTEraseAfter(&Plist, ret);
	SLTPrint(Plist);

	SLTPrint(Plist);


	SLTDestroy(&Plist);
}
int main()
{
	Test6();
	return 0;
}

